package com.tchy.cloud.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created by xiaoji on 2017/2/20.
 */
@Entity
@Table(name = "a_columns", schema = "", catalog = "")
public class AColumnsEntity {
    private Integer columnsId;
    private String title;
    private String intro;
//    private Integer parent;
    private AColumnsEntity aColumnsEntity;
    private String patentIds;
    private Integer sort;
    private Integer enable;
    private Integer deleted;
    private Integer guidePrefer;
    private Integer isDef;
    private Date createTime;
    private List<AColumnsEntity> aColumnsEntities = new ArrayList<>();

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "columns_id")
    public Integer getColumnsId() {
        return columnsId;
    }

    public void setColumnsId(Integer columnsId) {
        this.columnsId = columnsId;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "intro")
    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

//    @Basic
//    @Column(name = "parent")
//    public Integer getParent() {
//        return parent;
//    }
//
//    public void setParent(Integer parent) {
//        this.parent = parent;
//    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "parent")
    public AColumnsEntity getaColumnsEntity() {
        return aColumnsEntity;
    }

    public void setaColumnsEntity(AColumnsEntity aColumnsEntity) {
        this.aColumnsEntity = aColumnsEntity;
    }

    @Basic
    @Column(name = "patent_ids")
    public String getPatentIds() {
        return patentIds;
    }

    public void setPatentIds(String patentIds) {
        this.patentIds = patentIds;
    }

    @Basic
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "enable")
    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    @Basic
    @Column(name = "deleted")
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Basic
    @Column(name = "guide_prefer")
    public Integer getGuidePrefer() {
        return guidePrefer;
    }

    public void setGuidePrefer(Integer guidePrefer) {
        this.guidePrefer = guidePrefer;
    }

    @Basic
    @Column(name = "is_def")
    public Integer getIsDef() {
        return isDef;
    }

    public void setIsDef(Integer isDef) {
        this.isDef = isDef;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "aColumnsEntity")
    public List<AColumnsEntity> getaColumnsEntities() {
        return aColumnsEntities;
    }

    public void setaColumnsEntities(List<AColumnsEntity> aColumnsEntities) {
        this.aColumnsEntities = aColumnsEntities;
    }
}
